package com.zqq.user.injection.module

import com.zqq.user.service.UserService
import com.zqq.user.service.impl.UserServiceImpl
import com.zqq.user.service.impl.UserServiceImpl2
import dagger.Module
import dagger.Provides
import javax.inject.Named

/**
 * 用户模块Module
 * @author zqq on 2018/7/26
 */
@Module
class UserModule {

    @Provides
    @Named("service")
    fun provideUserService(serviceImpl: UserServiceImpl): UserService {
//        return UserServiceImpl()
        return serviceImpl
    }


    //测试限定符（所以每一个实现UserService的类都要添加@Field）
    @Provides
    @Named("service2")
    fun provideUserService2(serviceImpl: UserServiceImpl2): UserService {
        return serviceImpl
    }

}